Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix dependency and subdir in repoquery whoneeds #3743

Merged
merged 4 commits into from
Jan 20, 2025

Conversation

Hind-M
Copy link
Member

@Hind-M Hind-M commented Jan 14, 2025

@Hind-M Hind-M added the release::bug_fixes For PRs fixing bugs label Jan 14, 2025
@Hind-M Hind-M changed the title Fix subdir in repoquery Fix dependency and subdir in repoquery whoneeds Jan 15, 2025
@@ -599,7 +592,7 @@ namespace mamba
}

std::vector<mamba::printers::FormattedString> headers;
std::vector<std::string_view> cmds, args;
std::vector<std::string> cmds, args;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the bug as cmds and args were refering to sfmt after it was out of scope, and this was only appearing in osx and windows...

@@ -670,7 +663,7 @@ namespace mamba
}
else if (cmd == "Subdir")
{
row.emplace_back(get_subdir(pkg.channel));
row.emplace_back(pkg.platform);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was not tested and was returning the channel conda-forge instead of the subdir.

res = helpers.umamba_repoquery("whoneeds", "-c", "conda-forge", spec, "--platform", "osx-64")
assert "Name Version Build Depends Channel Subdir" in helpers.remove_whitespaces(res)
if spec == "xtensor=0.24.5": # `Depends` column is empty here (bug?)
assert "cascade 0.1.1 py38h5ce3968_0 conda-forge osx-64" in helpers.remove_whitespaces(res)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if the current behavior in this case (specifying the spec version) is the appropriate one (need to look into it more with maybe more context).

Copy link
Member

@jjerphan jjerphan Jan 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The first builds of cascade (i.e. the ones of 0.1.1) depend on xtensor, but not on xtensor==0.24.5, here is one of their index.json:

{
  "arch": "x86_64",
  "build": "py310ha6c322b_0",
  "build_number": 0,
  "depends": [
    "boost-cpp >=1.78.0,<1.79.0a0",
    "fmt >=9.1.0,<10.0a0",
    "hdf5 >=1.12.2,<1.12.3.0a0",
    "heyoka >=0.21.0",
    "heyoka >=0.21.0,<0.22.0a0",
    "heyoka.py >=0.21.0",
    "libcxx >=14.0.6",
    "numpy",
    "pybind11-abi 4",
    "python >=3.10,<3.11.0a0",
    "python_abi 3.10.* *_cp310",
    "spdlog >=1.11.0,<1.12.0a0",
    "tbb >=2021.8.0",
    "xtensor",
    "xtensor-blas"
  ],
  "license": "MPL-2.0",
  "name": "cascade",
  "platform": "osx",
  "subdir": "osx-64",
  "timestamp": 1677367283346,
  "version": "0.1.1"
}

Probably those builds of cascade have been done against xtensor==0.24.5.

I think xtensor should be reported in this case, as it is the case with:

micromamba repoquery whoneeds xtensor -c conda-forge --platform osx-64 | grep cascade
 cascade                           0.1.1   py38h5ce3968_0               xtensor                       conda-forge conda-forge
 cascade                           0.1.1   py310ha6c322b_0              xtensor                       conda-forge conda-forge
 cascade                           0.1.1   py39hb1d9d96_0               xtensor                       conda-forge conda-forge

What do you think?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, after thinking about it, it seems redundant as we already know what Depends should be set to (the spec already in the command), but let's do it this way to be consistent with the case where no constraints are given.

@Hind-M Hind-M marked this pull request as ready for review January 16, 2025 10:34
micromamba/tests/test_repoquery.py Outdated Show resolved Hide resolved
libmamba/src/core/query.cpp Show resolved Hide resolved
res = helpers.umamba_repoquery("whoneeds", "-c", "conda-forge", spec, "--platform", "osx-64")
assert "Name Version Build Depends Channel Subdir" in helpers.remove_whitespaces(res)
if spec == "xtensor=0.24.5": # `Depends` column is empty here (bug?)
assert "cascade 0.1.1 py38h5ce3968_0 conda-forge osx-64" in helpers.remove_whitespaces(res)
Copy link
Member

@jjerphan jjerphan Jan 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The first builds of cascade (i.e. the ones of 0.1.1) depend on xtensor, but not on xtensor==0.24.5, here is one of their index.json:

{
  "arch": "x86_64",
  "build": "py310ha6c322b_0",
  "build_number": 0,
  "depends": [
    "boost-cpp >=1.78.0,<1.79.0a0",
    "fmt >=9.1.0,<10.0a0",
    "hdf5 >=1.12.2,<1.12.3.0a0",
    "heyoka >=0.21.0",
    "heyoka >=0.21.0,<0.22.0a0",
    "heyoka.py >=0.21.0",
    "libcxx >=14.0.6",
    "numpy",
    "pybind11-abi 4",
    "python >=3.10,<3.11.0a0",
    "python_abi 3.10.* *_cp310",
    "spdlog >=1.11.0,<1.12.0a0",
    "tbb >=2021.8.0",
    "xtensor",
    "xtensor-blas"
  ],
  "license": "MPL-2.0",
  "name": "cascade",
  "platform": "osx",
  "subdir": "osx-64",
  "timestamp": 1677367283346,
  "version": "0.1.1"
}

Probably those builds of cascade have been done against xtensor==0.24.5.

I think xtensor should be reported in this case, as it is the case with:

micromamba repoquery whoneeds xtensor -c conda-forge --platform osx-64 | grep cascade
 cascade                           0.1.1   py38h5ce3968_0               xtensor                       conda-forge conda-forge
 cascade                           0.1.1   py310ha6c322b_0              xtensor                       conda-forge conda-forge
 cascade                           0.1.1   py39hb1d9d96_0               xtensor                       conda-forge conda-forge

What do you think?

@Hind-M Hind-M merged commit 4a69e30 into mamba-org:main Jan 20, 2025
34 checks passed
@Hind-M Hind-M deleted the whoneeds_output branch January 20, 2025 16:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release::bug_fixes For PRs fixing bugs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

repoquery whoneeds no longer lists package version dependency
2 participants